﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Coldairarrow.Util.ClassLibrary;

namespace Coldairarrow.Api.Extentions
{
    /// <summary>
    /// 配置扩展管道
    /// </summary>
    public static class SettingExtentions
    {
        public static IServiceCollection AddSetting(this IServiceCollection services, IConfiguration configuration)
        {
            services.Configure<RedisOptions>(configuration.GetSection("Cache"));
            services.Configure<MongoDBOptions>(configuration.GetSection("MongoDB"));
            services.Configure<ParameterOptions>(configuration.GetSection("Parameter"));
            return services;
        }
    }
}
